package service;
import com.jfinal.kit.Ret;

import model.MonitoringStation;
import model.Staff;
import model.Station;

public class MonitoringStationService extends BaseService {

	public Ret save(MonitoringStation monitoringStation , Station station , Staff staff) {
	    MonitoringStation ex = MonitoringStation.dao.findFirstByStationId(station.getId());
	    if(null == ex){
	    	monitoringStation.setStationId(station.getId());
	        monitoringStation.save();
	    }else{
	    	monitoringStation.setId(ex.getId());
	        monitoringStation.update() ;
	    }
	    station.setStaffId(staff.getId());
	    station.update();
	    return ok() ;
	}
}
